<template>
  <div>
    <h1>我是List</h1>
    <h5>我是List的{{ count }}</h5>
    <button @click="getListMovie">请求电影列表</button>
    <ul>
      <li v-for="item in movie" :key="item.tvId">
        {{ item.name }}
      </li>
    </ul>
    <ul>
      <li v-for="item in movieN" :key="item.tvId">
        {{ item.name }}
      </li>
    </ul>
    <hr>
    <ul>
      <li v-for="item in movieY" :key="item.tvId">
        {{ item.name }}
      </li>
    </ul>
  </div>
</template>
<script>
import { mapActions, mapGetters, mapState } from "vuex";

export default {
  name: "List",
  updated(){
    console.log(this.movieY);
  },
  computed: {
    ...mapState("count", ["count"]),
    ...mapState("count", ["movie"]),
    ...mapGetters("count", ["movieN"]),

    movieY(){
      return this.$store.getters["count/movieY"]({n:2,m:4})
    }
  },
  methods: {
    ...mapActions("count", ["getListMovie"]),
  },
};
</script>

<style>
</style>